<template>
	<view class="page">
		<!-- 搜索筛选 -->
		<view class="search-select">
			<view class="search">
				<view class="iconfont iconsearch"></view>
				<input class="input" type="text" value="" placeholder="高考分数" placeholder-class="placeholder" />
			</view>
			<view class="shaixuan-btn" @click.stop="shaixuanOpen">
				<image src="../../static/shaixuan-icon.png" mode=""></image>
				筛选
			</view>
		</view>
		<view class="select-wrap">
			<ChooseLits :list="list" :arr="arr" @chooseLike="chooseLike"></ChooseLits>
		</view>
		<!-- 列表 -->
		<view class="search-result-wrap">
			<view class="search-result-num">
				共匹配
				<text class="red">365</text>
				所学校
			</view>
			<view class="table-wrap">
				<view class="th">
					<view class="td">
						学校名称
					</view>
					<view class="td">
						专业
					</view>
					<view class="td" style="white-space: pre-line;">
						最低分
						/最低位次
					</view>
					<view class="td">
						选科要求
					</view>
				</view>
				<view class="tr" v-for="(item,index) in 10" :key="index">
					<view class="td">
						北京大学
						<view class="tags">
							<view class="text">985</view>
							<view class="text">211</view>
						</view>
					</view>
					<view class="td">
						数字媒体艺术设计
						<view class="tags">
							<view class="text">重点学科</view>
							<view class="text">重点学科</view>
						</view>
					</view>
					<view class="td">
						295/658
					</view>
					<view class="td">
						<text class="text">物理</text>
						<text class="text">化学</text>
						<text class="text">地理</text>
					</view>
				</view>
			</view>
		</view>
		
		<uni-popup ref="popup" type="right">
			<view class="shaixuan-popup-right">
				<view class="row">
					<view class="title">
						专业特性
					</view>
					<view class="tags">
						<text>985工程</text>
						<text>211工程</text>
						<text>一流大学</text>
					</view>
				</view>
				<view class="row">
					<view class="title">
						门类
					</view>
					<view class="select">
						<picker @change="bindPickerChange" :value="index" :range="array">
							<view class="uni-input" v-if="index == -1">请选择考试阶段</view>
							<view class="uni-input" v-else>{{array[index]}}</view>
						</picker>
						<view class="iconfont iconxxjtfull"></view>
					</view>
				</view>
				<view class="row">
					<view class="title">
						专业大类
					</view>
					<view class="select">
						<picker @change="bindPickerChange" :value="index" :range="array">
							<view class="uni-input" v-if="index == -1">请选择考试类型</view>
							<view class="uni-input" v-else>{{array[index]}}</view>
						</picker>
						<view class="iconfont iconxxjtfull"></view>
					</view>
				</view>
				<view class="row">
					<view class="title">
						专业
					</view>
					<view class="select">
						<input type="digit" value="" placeholder="请填写专业" placeholder-class="placeholder" />
					</view>
				</view>
				<view class="btn-wrap">
					<view class="reset-btn">
						重置
					</view>
					<view class="submit-btn">
						确定
					</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	import ChooseLits from '@/components/choose-Cade/choose-Cade.vue'
	export default {
		components: {
			uniPopup,
			uniPopupMessage,
			uniPopupDialog,
			ChooseLits
		},
		data() {
			return {
				index: -1,
				array: ['2020-01-01', '2020-01-02', '2020-01-03', '2020-01-04'],
				list: ['所属地区', '学校类型', '主管部门','办学类型'],
				arr: [
					['重庆', '四川', '北京'],
					['艺体生', '非艺体生'],
					['第一批', '第二批', '第三批'],
					['一月份', '二月份', '三月份','四月份','五月份']
				],
				i2: [0, 0, 0,0],
			}
		},
		methods: {
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.target.value)
				this.index = e.target.value
			},
			shaixuanOpen() {
				this.$refs.popup.open()
			},
			chooseLike(i1) {
				if (this.i2[i1[0]] != i1[1]) {
					this.i2[i1[0]] = i1[1];
				}
				console.log(this.i2)
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import  'zhinengtuijian.scss';
	@import '../../common/icon/iconfont.css';
</style>
